<template>
  <div id="read">
    <div class="read-top">
      <div class="vourse-img">
        <img :src="require('@/assets/img/tuijianyuedu.webp')" alt="" />
      </div>
      <span>推荐阅读</span>
    </div>
    <div class="read-bottom">
      <div class="read-center" v-for="item in readlist" :key="item" v-lazy="item">
        <div class="read-center-left">
          <img :src="item.image" alt="" />
        </div>
        <div class="read-center-right">
          <p class="p1">{{ item.title }}</p>
          <p class="p2">{{ item.content }}</p>
          <div class="enlightenment">
            <div class="enlightenment-rig">{{ item.tag }}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { getread } from "../../utils/api";

export default {
  data() {
    return {
      readlist: []
    };
  },

  components: {},

  computed: {},

  mounted() {
    this.getreadlist();
  },

  methods: {
    async getreadlist() {
      const res = await getread();
      this.readlist = res.result;
    }
  }
};
</script>
<style lang="scss" scoped>
#read {
  margin-top: 10px;
  width: 100%;
  padding: 0 10px;
  box-sizing: border-box;
  border-radius: 10px;
  .read-top {
    width: 100%;
    height: 60px;
    display: flex;
    // justify-content: center;
    align-items: center;
    span {
      font-size: 17px;
      margin-left: 5px;
      font-weight: 600;
    }
    .vourse-img {
      width: 30px;
      height: 30px;
      img {
        width: 24px;
        height: 25px;
      }
    }
  }
  .read-bottom {
    box-sizing: border-box;
    width: 100%;
    // height: 400px;
    border-radius: 20px;
    padding: 10px;
    border: 2px #f1f5f7 solid;
    .read-center {
      padding: 10px 0;
      height: 110px;
      width: 100%;
      display: flex;
      justify-content: space-between;
      border-bottom: 2px #f1f5f7 dashed;
      .read-center-left {
        width: 68.5px;
        height: 68.5px;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .read-center-right {
        width: 250px;
        height: 68.5px;
        p {
          text-align: left;
          display: block;
          margin: 0;
        }
        .p1 {
          font-weight: 600;
          font-size: 15.5px;
          line-height: 15.5px;
        }
        .p2 {
          margin-top: 10px;
          font-size: 11.5px;
          line-height: 11.5px;
        }
        .enlightenment {
          margin-top: 20px;
          width: 100%;
          height: 15.5px;
          display: flex;
          justify-content: flex-end;
          .enlightenment-rig {
            font-size: 11.5px;
            background: #dfdfdf;
            color: #32dfff;
          }
        }
      }
    }
  }
}
</style>
